package com.hbnu.tangyalu;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class HashMapDemo {
    public static void main(String[] args) {
        Map<String,String> hashmap=new HashMap<>();
        hashmap.put("name","tyl");
        hashmap.put("age","20");
        hashmap.put("adress","18-415");
        System.out.println(hashmap);
        System.out.println(hashmap.get("name"));
        System.out.println("----------");
        Set<String> keySet = hashmap.keySet();
        for (String key:keySet) {
            System.out.println(key+"="+hashmap.get(key));
        }
        Collection<String> values = hashmap.values();
        for (String value:values) {
            System.out.println(value);
        }


    }
}
